<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simCheckOctreePointOccupancy</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simCheckOctreePointOccupancy" id="simCheckOctreePointOccupancy"></a>simCheckOctreePointOccupancy / sim.checkOctreePointOccupancy </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Checks whether the provided points collide with the <a href="../octrees.htm">OC tree</a> voxels. See also <a href="simInsertVoxelsIntoOctree.htm">sim.insertVoxelsIntoOctree</a> and the other <a href="../apiFunctions.htm#octree">OC tree related functions</a>.</td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt checkOctreePointOccupancy(simInt octreeHandle,simInt options,const simFloat* pts,simInt ptCnt,simUInt* tag,simUInt64* location,simVoid* reserved)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>octreeHandle</strong>: the handle of the OC tree. See also <a href="simGetObjectHandle.htm">sim.getObjectHandle</a></div>
<div><strong>options</strong>: bit-coded:</div>
<div class=tab>bit0 set (1): specified points are relative to the OC tree reference frame, otherwise they are relative to the world reference frame</div>
<div><strong>pts</strong>: a pointer to the points specified as X/Y/Z coordinates</div>
<div><strong>ptCnt</strong>: the number of points contained in pts</div>
<div><strong>tag</strong>: a pointer to a tag value, receiving the tag value of the voxel that collides with a single point. If several points are tested, then this pointer is ignored. Can be nullptr.</div>
<div><strong>location</strong>: a pointer to a uint64 value, which specifies the location of the voxel that collides with a single point. If several points are tested, then this pointer is ignored. Can be nullptr. The location value is coded in following way:</div>
<div class=tab>bit0 - bit5: the depth level of the voxel in the OC tree structure (1-63).</div>
<div class=tab>bit6 - bit63: a triple bit-value for each depth level. triple bit-values represent the node location relative to the parent node:</div>
<div class=tabTab>0: (-1,-1,-1)</div>
<div class=tabTab>1: (+1,-1,-1)</div>
<div class=tabTab>2: (-1,+1,-1)</div>
<div class=tabTab>3: (+1,+1,-1)</div>
<div class=tabTab>4: (-1,-1,+1)</div>
<div class=tabTab>5: (+1,-1,+1)</div>
<div class=tabTab>6: (-1,+1,+1)</div>
<div class=tabTab>7: (+1,+1,+1)</div>
<div class=tab></div>
<div class=tab>as an example, 0xE02 would indicate a depth level 2, with coordinates: (+1,+1,+1)*voxelSize*2+(-1,-1,-1)*voxelSize.</div>

<div><strong>reserved</strong>: reserved for future extensions. Set to nullptr</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 if operation was not successful, 0 if the points do not collide with the voxels, 1 if the points collide with the voxels</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>int result,int tag,int locationLow,int locationHigh=sim.checkOctreePointOccupancy(int octreeHandle,int options,table[] points)</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div>Similar to the C-function counterpart</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div>if a single point is specified and collides with a voxel, 4 values are returned, otherwise only <strong>result</strong> will be returned. The <strong>location</strong> value is divided into a low- and high-value (i.e. first 32 bits and last 32 bits of <strong>location</strong>).</div>
</td> 
</tr> 
</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
